package game.asset
{
	import engine.asset.*;
	import engine.core.*;
	import engine.graphics.*;
	import engine.loaders.*;
	import flash.system.*;
	import game.graphics.*;
	import game.graphics.shader.*;
	
	public class RxAssetScene extends RxAsset
	{
		private var m_xml:XML;
		private var m_assetGroup:RxAssetGroup;
		private var m_modelMap:Object;
		private var m_imageMap:Object;
		private var m_models:Vector.<RxModelInstance>;
		private var m_cubemaps:Object;
		private static var s_type:int;
		private static const STATE_XMLREADY:int = 4;
		private static const STATE_LOADINGASSETS:int = 5;
		
		public function RxAssetScene(xml:int = 0)
		{
			super(xml != 0 ? (xml) : (s_type));
			this.m_xml = null;
			this.m_assetGroup = null;
			this.m_modelMap = null;
			this.m_imageMap = null;
			this.m_models = null;
			this.m_cubemaps = null;
		}
		
		public static function Initialize() : void
		{
			s_type = RxAsset.RegisterType("scene", CreateFromXML);
		}
		
		public static function CreateFromXML(xml:XML, param2:String) : RxAssetScene
		{
			var name:* = xml.@name;
			var url:* = xml.@url;
			url = RxUtilities.MergePath(param2, url);
			return Create(url, name);
		}
		
		public static function Create(param1:String, param2:String) : RxAssetScene
		{
			var _loc_3:* = GetByURL(param1);
			if (_loc_3 != null)
			{
				var _loc_4:* = _loc_3;
				var _loc_5:* = _loc_3.m_references + 1;
				_loc_4.m_references = _loc_5;
				return _loc_3;
			}
			_loc_3 = new RxAssetScene;
			_loc_3.SetURL(param1);
			_loc_3.SetName(param2);
			return _loc_3;
		}
		
		public static function GetByURL(param1:String) : RxAssetScene
		{
			return RxAssetScene(_getByURL(param1, s_type));
		}
		
		public static function GetByName(param1:String) : RxAssetScene
		{
			return RxAssetScene(_getByName(param1, s_type));
		}
		
		public function GetXML() : XML
		{
			return this.m_xml;
		}
		
	}
}